<form class="tableform" method="post" action="index.php?app=desktop&ctl=lang&act=save_fanyi" id='messenger-msg-form' >
<{foreach from=$fanyi item=item}>
<div class="division">
	<h4><{t}>中文<{/t}></h4>
	<input type="hidden" name="fanyi[<{$item.id}>][id]" value=<{$item.id}> />
 <{input type="textarea" style="width:100%;" value=$item.key readonly="true" rows="3"}>
	<h4><{t}>俄文<{/t}></h4>
 <{input type="textarea" style="width:100%;"  value=$item.lkey rows="3" name="fanyi[{$item.id}][lkey]" vtype="required"}>
 </div>
 <{/foreach}>
<div class="table-action">
	<{button label=$___b2c="保存"|t:'desktop' type="submit" id="msg-form-submit"}>
</div>
</form>
<script>
(function(){

    var _form = $('messenger-msg-form');
    var btn =$('msg-form-submit');

    _form.store('target',{
    	onRequest:function() {
    		btn.set('disabled', true);
    	},
        onComplete:function(){

        },
        onSuccess:function(response){
            var hash_res_obj = JSON.decode(response);
            if (hash_res_obj.success != undefined && hash_res_obj.success != "")
            {
                try{
                    var _dialogIns = btn.getParent('.dialog').retrieve('instance');
                }catch(e){}

                if(_dialogIns)
                {
                    _dialogIns.close();
                }
            }
            else
            {
            }
        }
    });
})();

</script>